
import java.util.Random;
import java.util.Scanner;

public class ljs {

	public static void main(String[] args){  
 
		String number = "";  
		Random rd = new Random();  
		while (number.length() != 4) {  
			String rn = rd.nextInt(10) + "";  
			if (number.length()==1){  
				if ("0".equals(rn)){  
					continue;  
				}  
			}  
			if (number.indexOf(rn) == -1){  
				number += rn;  
			}  
		}  
	}
}		